package com.mt.api.util;

import cn.hutool.core.date.DateUtil;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;
import java.util.Objects;

/**
 * @Author: plover
 * @Date: 2022/06/13 22:38
 * @Description:
 */
public class CommonUtil {

    public static boolean checkVipExpiryDate(Date expiryDate) {
        if (Objects.isNull(expiryDate)) {
            return false;
        }
        String today = DateUtil.today();
        if (StringUtils.equals(DateUtil.formatDate(expiryDate), today)) {
            return true;
        }
        return DateUtil.compare(expiryDate, new Date()) > 0;
    }

}
